/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.uniminuto.edu.videominuto.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Juan
 */
@Embeddable
public class RegPersonasPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_video")
    private int idVideo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_persona")
    private int idPersona;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_tipo_persona")
    private int idTipoPersona;

    public RegPersonasPK() {
    }

    public RegPersonasPK(int idVideo, int idPersona, int idTipoPersona) {
        this.idVideo = idVideo;
        this.idPersona = idPersona;
        this.idTipoPersona = idTipoPersona;
    }

    public int getIdVideo() {
        return idVideo;
    }

    public void setIdVideo(int idVideo) {
        this.idVideo = idVideo;
    }

    public int getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(int idPersona) {
        this.idPersona = idPersona;
    }

    public int getIdTipoPersona() {
        return idTipoPersona;
    }

    public void setIdTipoPersona(int idTipoPersona) {
        this.idTipoPersona = idTipoPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idVideo;
        hash += (int) idPersona;
        hash += (int) idTipoPersona;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RegPersonasPK)) {
            return false;
        }
        RegPersonasPK other = (RegPersonasPK) object;
        if (this.idVideo != other.idVideo) {
            return false;
        }
        if (this.idPersona != other.idPersona) {
            return false;
        }
        if (this.idTipoPersona != other.idTipoPersona) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.uniminuto.edu.videominuto.entities.RegPersonasPK[ idVideo=" + idVideo + ", idPersona=" + idPersona + ", idTipoPersona=" + idTipoPersona + " ]";
    }
    
}
